package com.ywk.json.core.impl;


import com.ywk.json.core.IOutPut;
import com.ywk.json.entity.User;
import com.ywk.json.entity.User2;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zbh
 * @date 2022/3/9 14:07
 */
public class OutPutHandler2 implements IOutPut {

    @Override
    public List<User2> outPut(List contentList) {
        List<User2> user2List=new ArrayList<>();
        for (Object item : contentList) {
            User user=(User)item;
            User2 user2 = new User2();
            BeanUtils.copyProperties(user,user2);
            user2List.add(user2);
        }
        System.out.println("===============user2List=================");
        user2List.forEach(System.out::println);
        return user2List;
    }
}
